﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ThoughtWorks {
    public class CommonIo {
        public static string GetTestFile(string fileName)
        {
            string filePath = System.AppDomain.CurrentDomain.BaseDirectory + "\\testdata\\" + fileName;
            if (File.Exists(filePath))
            {
                return filePath;
            }
            else
            {
                string message = CommonIo.GetFileNotFoundMessage(filePath);
                throw new Exception(message);
            }
        }

        internal static string GetFileNotFoundMessage( string testDataPath) {
           return String.Format("Can not find file: {0}",testDataPath);
       }
    }
}
